import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: qian
 * Date: 2022-07-19
 * Time: 17:59
 */
public class Test {
    public void func1(int[] array){
        HashSet<Integer> set=new HashSet<>();
        for(int i=0;i<array.length;i++){
            set.add(array[i]);
        }
        System.out.println(set);
    }
    public void func2(int[] array){
        HashSet<Integer> set=new HashSet<>();
        for (int i=0;i<array.length;i++){
            if(!set.contains(array[i])){
                set.add(array[i]);
            }else{
                System.out.println(array[i]);
                return;
            }
        }
    }
    public HashMap<Integer, Integer> func3(int[] array){
        HashMap<Integer,Integer> map=new HashMap<>();
        for (int i=0;i<array.length;i++){
            if(map.containsKey(array[i])){
                int val=map.get(array[i]);
                map.put(array[i],val+1);
            }else {
                map.put(array[i],1);
            }
        }
        return map;
    }
    public static void main(String[] args) {

    }
    public static void main1(String[] args) {
        HashBuck hashBuck=new HashBuck();
        hashBuck.put(1,99);
        hashBuck.put(4,99);
        hashBuck.put(5,99);
        hashBuck.put(36,99);
        hashBuck.put(5,99);
        hashBuck.put(15,99);
        hashBuck.put(7,99);
        System.out.println("sss");
    }
}
